<template>
	<view>
		<view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30" @click="pageActive('pages/user/views/personal')">
			<view class="u-m-r-10 avatar">
				<open-data type="userAvatarUrl"></open-data>	
			</view>
			<view class="u-flex-1">
				<view class="u-font-18 u-p-b-20">{{nikeName}}</view>
				<view class="u-font-14 u-tips-color">{{userName}}</view>
			</view>
			<view class="u-m-l-10 u-p-10">
				<u-icon name="scan" color="#969799" size="28"></u-icon>
			</view>
			<view class="u-m-l-10 u-p-10">
				<u-icon name="arrow-right" color="#969799" size="28"></u-icon>
			</view>
		</view>
		
		<view class="u-m-t-20">
			<u-cell-group>
				<u-cell-item icon="chat" title="最新消息"></u-cell-item>
			</u-cell-group>
		</view>
		
		<view class="u-m-t-20">
			<u-cell-group >
				<u-cell-item icon="account" title="出勤记录"  @click="pageActive('pages/user/views/cqjl')"></u-cell-item>
				<!-- <u-cell-item icon="calendar" title="我的评价" @click="pageActive('pages/user/views/wdpj')"></u-cell-item>
				<u-cell-item icon="calendar" title="待处理事项" @click="pageActive('pages/user/views/dclsx')">
					<u-badge type="error" :count="countMsg" :offset="[30,60]"></u-badge>
				</u-cell-item> -->
			</u-cell-group>
		</view>
		
		<view class="u-m-t-20">
			<u-cell-group>
				<u-cell-item icon="chat" title="开通消息订阅服务" @click="pageActive('pages/user/views/xxdy')"></u-cell-item>
			</u-cell-group>
		</view>
		
		<view class="u-m-t-20">
			<u-cell-group>
				<u-cell-item icon="setting" title="设置"></u-cell-item>
			</u-cell-group>
		</view>
	</view>
</template>

<script>
import { mapState} from 'vuex';
	export default {
		computed:mapState(['user', ]),
		data() {
			return {
				avatarUrl:'',
				nikeName: '',
				show:true,
				countMsg:'0',
				userName:'',
			}
		},
		onLoad() {
			this.userName = this.user.user.name;
			this.avatarUrl = this.user.user.avatarUrl;
			this.nikeName = this.user.user.nikeName;
		},
		methods: {
			pageActive(path){
				this.$u.route(path);
			},
			click(index){
				console.log(index)
			}
		}
	}
</script>

<style lang="scss">
page{
	background-color: #ededed;
}

.camera{
	width: 54px;
	height: 44px;
	
	&:active{
		background-color: #ededed;
	}
}
.user-box{
	background-color: #fff;
	//margin-top: 20rpx;
}
.avatar{
	width: 150rpx;
	height: 150rpx;
	border-radius: 100rpx;
	margin-top: 20rpx;
}
</style>
